import dayjs from 'dayjs'
import * as relativeTime from 'dayjs/plugin/relativeTime' // import plugin
import 'dayjs/locale/zh-cn' // import locale
dayjs.locale('zh-cn') // use locale
export const toTimeAge = (targetTime) => {
  dayjs.extend(relativeTime) // use plugin
  var a = dayjs()
  var b = dayjs(targetTime)
  return a.to(b) // in 2 years
}
